import java.util.Scanner;

public class Go_to_School {
    public static void main(String[] args){
        Clock clock=new Clock(8,0);
        Scanner scanner=new Scanner(System.in);
        int s=scanner.nextInt();
        int v=scanner.nextInt();
        //这里原则上应该加上判断，s得大于1，v得小于10000
        int minutes=computeMinutes(s,v);
        clock=Clock.compute(clock,minutes);
        System.out.println(clock);
    }
    public static int computeMinutes(int s,int v){
        if(s%v!=0){
            return 11+(s/v);
        }
        else {
            return 10+(s/v);
        }
    }
    public static class Clock{
        private int hour;
        private int minute;
        public Clock(int hour,int minute){
            this.hour=hour;
            this.minute=minute;
        }
        public static Clock compute(Clock clock,int minutes){
            int hour=(minutes/60)%24;
            int minute=minutes%60;
            double day=((double)minutes/60)/24;
            if(day>1){
                System.out.println("注意，输入的数值已经表面提前了超过一天了");
            }
            if(clock.minute-minute<0){
                clock.minute=60-(minute-clock.minute);
                hour++;
            }
            else {
                clock.minute=clock.minute-minute;
            }
            if(clock.hour-hour<0){
                clock.hour=24-(hour-clock.hour);
            }
            else {
                clock.hour=clock.hour-hour;
            }
            return clock;
        }

        @Override
        public String toString() {
            return String.format("%02d:%02d",hour,minute);
        }
    }
}
